// 引入 express
const express = require('express')
const router = express.Router()
const responseData = {
  'code' : 0,
  'msg' : '',
  'data': {}
}

// 统一使用这种格式
router.use((req, res, next) => {
  responseData
  next()
})
// 请求/api/v2/login
router.get("/login",function (req, res) {
  responseData.code = 200
  responseData.msg = 'v2版本登录请求'
  res.json(responseData)
})
// 请求/api/v2/register
router.get("/register",function (req, res) {
  responseData.code = 200
  responseData.msg = 'v2版本注册请求'
  res.json(responseData)
})

// 导出模块
module.exports = router;
